<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>历史授权</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <style type="text/css">
        html,
        body {
            height: 100%;
            margin: 0
        }

        .header_return {
            background-image: url(../image/we_return.png);
            background-repeat: no-repeat;
            background-size: 18px 23px;
            background-position: center;
            width: 45px;
            height: 100%;
            display: block;
        }

        .header_context {
            font-size: 18px;
            color: #fff;
            text-align: center;
            line-height: 45px;
            -webkit-box-flex: 1.0;
            display: block;
        }

        .header_right {
            width: 11%;
            height: 100%;
            display: block;
        }
    </style>
</head>

<body>

<header style="width:100%;height:65px;background-color:#ff9900">
    <div class="header_div" style="height:45px;display:-webkit-box;padding-top:20px;">
        <div class="header_return"></div>
        <div class="header_context">历史授权</div>
        <div class="header_right"></div>
    </div>
</header>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
<script type="text/javascript" src="../script/common.js"></script>

<script type="text/javascript">
    apiready = function () {
        //适配iOS7+，Android4.4+状态栏沉浸式效果，详见config文档statusBarAppearance字段，不要这句话，添加后会报js引用错误
//        $api.fixStatusBar($api.dom('header'));


//			初始化界面
        initView();
    };

    function initView() {
//        添加返回功能
        $('.header_return').click(function () {
            api.closeWin({});
        })
        //        打开历史授权的frame
        openFm();
    }


    /**
     * 打开frame ：历史授权
     */
    function openFm() {
//        需要打开的url和name
        var fmUrl = './history_frame.html';
        var fmName = 'history_frame';
        api.openFrame({
            name: fmName,
            url: fmUrl,
            rect: {
                x: 0,
                y: getFrameY(),
                w: api.winWidth,
                h: 'auto'
            }
        });
    }

    function getFrameY() {
        var frameheigh = $api.dom('header').offsetHeight;
        var systemType = api.systemType;
        if (api.systemType === 'ios') {
            var systemVersion = api.systemVersion;
            if (parseFloat(systemVersion) >= 11.0) {
                frameheigh = frameheigh + 20;
            }
            return frameheigh;
        }
        return frameheigh;
    }

</script>

</html>
